package com.example.controller.siyunDaohanglanController;

import com.example.pojo.siyunDaohanglanPojo.SiyunDaohanglanNode;
import com.example.pojo.siyunDaohanglanPojo.SiyunHeadDaohanglan;
import com.example.pojo.siyunDaohanglanPojo.SiyunHeadTiXing;
import com.example.service.siyunDaohanglanService.SiyunDaohanglanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class SiyunDaohanglanController {
    @Autowired
    private SiyunDaohanglanService siyunDaohanglanService;

    @PostMapping("/postGetDaohanglan")
    @ResponseBody
    @CrossOrigin
    public List<SiyunDaohanglanNode> getDaohanglan(){
        List<SiyunDaohanglanNode> daohanglanAll = siyunDaohanglanService.getDaohanglanAll();
        System.out.println(123);
        return daohanglanAll;
    }
/**
* @Author: lzr
* @Description: 获取用户基本信息
* @DateTime: 10:41 2022/12/13
* @Params:
* @Return
*/
    @PostMapping("/getHead")
    @ResponseBody
    @CrossOrigin
    public SiyunHeadDaohanglan getHead(@RequestBody SiyunHeadDaohanglan siyunHeadDaohanglan){
        return siyunDaohanglanService.getHead(siyunHeadDaohanglan);
    }
    /**
    * @Author: lzr
    * @Description: 获取提醒信息的各个次数
    * @DateTime: 19:52 2022/12/13
    * @Params:
    * @Return
    */
    @PostMapping("/getTixing")
    @ResponseBody
    @CrossOrigin
    public SiyunHeadTiXing getTixing(){
        return siyunDaohanglanService.getTixing();
    }
}
